// 运输计划
import request from '@/utils/request1'
// 查询运输单
function transportBillList(query) {
  return request({
    url: '/logistics/transportBill/list',
    method: 'get',
    params: query
  })
}
//   获取运输单详细信息
export function getTransportBillDetail(roleId) {
  return request({
    url: '/logistics/transportBill/' + roleId,
    method: 'get'
  })
}
// 查询物流公司信息列表
export function logisticsCompanyoList(query) {
  return request({
    url: '/logistics/company/list',
    method: 'get',
    params: query
  })
}
// 查询起点终点
export function getByType(query) {
  return request({
    url: '/logistics/location/getByType',
    method: 'get',
    params: query
  })
}
// 新增司机信息 ========================================================================
export function addDriver(data) {
  return request({
    url: '/logistics/driver',
    method: 'post',
    data: data
  })
}
//   修改司机信息
export function updateDriver(data) {
  return request({
    url: '/logistics/driver',
    method: 'put',
    data: data
  })
}
// 删除司机
export function delDriver(userId) {
  return request({
    url: '/logistics/driver/' + userId,
    method: 'delete'
  })
}

// 修改司机启用状态
export function setDriverEditEnabled(data) {
  return request({
    url: '/logistics/driver/editEnabled/' + data.ids + '/' + data.isEnabled,
    method: 'put'
  })
}
const obj = {
  transportBillList,
  logisticsCompanyoList,
  addDriver,
  updateDriver,
  getByType,
  delDriver,
  getTransportBillDetail,
  setDriverEditEnabled
}
export default obj
